<template>
	<view class="content">
		<view class="header" :style="{height: (navHeight + 12) + 'px'}">
			<view class="back" :style="{top:top + 'px',height: height + 'px'}">返回</view>
			<image src="../../static/820326a0851c29d382927959754a0358.jpeg" mode="" class="bg"></image>
		</view>
		<view class="">content</view>
		<!-- <image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
			<button @click="handleDetail">去详情</button>
			<image src="../../static/扫一扫.png" mode="" @click="handleScane"></image>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				navHeight: 0,
				top: 0,
				height: 0,
			}
		},
		onLoad() {
			const {top, height, bottom} = uni.getMenuButtonBoundingClientRect();
			// console.log(bottom)
			this.top = top
			this.height = height
			this.navHeight = bottom
			// console.log(result)
		},
		methods: {
			handleDetail() {
				uni.navigateTo({
					url: '/moduleB/detail/detail'
				})
			},
			handleScane() {
				uni.scanCode({

				}).then(res => {
					{
						
					}
					console.log(res)
				})
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	.box {
		width: 100rpx;
		height: 100rpx;
		background-color: red;
	}
	.header{
		position: relative;
		width: 750rpx;
	}
	.bg {
		position: absolute;
		left: 0;
		top: 0;
	}
	.back {
		position: absolute;
		left: 0;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
	}
</style>
